package com.eryos.android.holidaybudget;

import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Main extends RootActivity {

	private Button budgetButton;
    private Button expenseButton;
    private Button summaryButton;
    
	@Override
    protected void initParam(){
		Log.d(LOG_TAG, "initParam");

		viewTitle = "Holiday's Budget";
		hasTopBanner = true;
		hasBackButton = false;
	}

    @Override
    protected void initUI(){
        Log.d(LOG_TAG, "initUI");
 
        /* Define the Layout */
        setContentView(R.layout.main);
        
        showWaitingMessage();
    	
        /* Retrieve UI elements */
        budgetButton 	= (Button) findViewById(R.id.main_budget_button);
        expenseButton 	= (Button) findViewById(R.id.main_expense_button);
        summaryButton 	= (Button) findViewById(R.id.main_summary_button);
    }
    
    @Override
    protected void initHandlers(){
    	Log.d(LOG_TAG, "initHandlers");

    	budgetButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            	Log.d(LOG_TAG, "Click Budget Button");
            	loadView(VIEW.BUDGET);
            }
        });

    	expenseButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            	Log.d(LOG_TAG, "Click Expense Button");
            	loadView(VIEW.EXPENSE);
            }
        });

    	summaryButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            	Log.d(LOG_TAG, "Click Summary Button");
            	loadView(VIEW.SUMMARY);
            }
        });
}

    @Override
    protected void fetchData(){
        Log.d(LOG_TAG, "fetchData");

        refreshUI();
    }

    @Override
	protected void refreshUI() {
    	Log.d(LOG_TAG, "refreshUI");

    	hideWaitingMessage();
	}

}